Drop parent->realized => child->realized invariant
authorAlexander Larsson <alexl@redhat.com>
Tue, 28 Apr 2020 12:32:57 +0000 (14:32 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 28 Apr 2020 12:32:57 +0000 (14:32 +0200)
commitc6104fe7fd8bc5922d4e6c4883b2bc33e3a94a57
tree8ff8c03dcd493652f97c1419f9c080a2a5d59ced
parentf66950f48c2773b45f40ac4fcf305a3f407c4130
Drop parent->realized => child->realized invariant

We already dropped this invariant in gtk_widget_verify_invariants()
because it was not true in all cases. Also, it is not really useful
these days as we extended what it means to be a "child" to also
include widgets in different toplevels.

For example, a popup in a popup button need not be realized just
because the button is in a realized window. The main invariants
we want are:

 * Parent is realized before child
 * Widget is realized before it is mapped

This sounds like its not a huge deal, but in fact it is a massive win
for things like menus, because when we go between menus in a menubar
each switch between two open menus involves a lot of intermingled
crossing events to different surfaces and for each of these the
tooltip window of the toplevel gets assigned to the new surface.  This
shouldn't be a huge deal, as the tooltip window is not even visible,
but due to the realized invariant it get re-realized each time it gets
re-assigned.
gtk/gtkwidget.c